<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>跳动的心</title>
    <style>
        *{
            margin:0;
            padding:0;
        }
        /*让容器宽度和高度充满全屏*/
        html,body{
            width:100%;
            height:100%;
        }
        body{
            background-color: pink;
            display:flex;/*弹性盒子*/
            flex-direction: row;
            align-items: center;
            justify-content: center;
        }
        .heart{
            width:200px;
            height:200px;
            background-color: red;
            position:relative;
            transform: rotate(45deg);/*心顺时针旋转45°*/
            animation:heartbit 1s alternate infinite;
            box-shadow: 0 0 30px red;
        }
        .heart::before{
            content:"";/*伪元素*/
            width:200px;
            height:100px;
            position:absolute;
            top:-99px;
            left:0px;
            background-color: red;
            border-radius:100px 100px 0 0;
            box-shadow: 0 0 30px red;
        }
        .heart::after{
            content:"";
            width:100px;
            height:200px;
            position:absolute;
            top:0px;
            left:-99px;/*隐形掉边界线*/
            background-color:red;
            border-radius:100px 0 0 100px;
            box-shadow: 0 0 30px red;/*阴影*/
        }
        @keyframes heartbit{
            0%{
                transform:rotate(45deg) scale(0.6)
            }
            100%{
                transform:rotate(45deg) scale(1.4)
            }
        }
    </style>
</head>
<body>
    
    <div class="heart"></div>

</body>
</html>